<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta name="author" content="wa">
    <title></title>
    <script src="../js/jquery-3.1.1.js"></script>
    <style>
        .top {
            width: 300px;
            height: 300px;
            margin: 100px auto;
            position: relative;
        }
        
        .biaoti li {
            list-style-type: none;
            display: inline-block;
            border: 1px solid #ccc;
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            float: left;
        }
        .biaoti li:nth-child(1) {
            border-right: none;
        }
        .top .xb{
            clear: both;
            position: relative;
        }
        .top .dd{
            width: 100px;
            display: none;
        }
        .top .dd li{
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border: 1px solid #ccc;
            border-top: none;
            list-style-type: none;
        }
        .top .xf{
            position: absolute;
            top:-16px;
            right: 56px;
            display: none;
        }
        .top .xf li{
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border: 1px solid #ccc;
            border-top: none;
            list-style-type: none;
        }
        .top .xb li:hover{
            background-color: #d3d3d3;
        }
        .top section{
            position: absolute;
            bottom: 150px;
            left: 120px;
        }
    </style>
</head>

<body>
    <div class="top">
        <div class="biaoti">
            <ul>
                <li id="dingdang">销售订单</li>
                <li id="xaiofei">消费订单</li>
            </ul>
        </div>
        <div class="xb">
            <ul class="dd">
                <li>订单1</li>
                <li>订单2</li>
                <li>订单3</li>
            </ul>
            <ul class="xf">
                <li>消费1</li>
                <li>消费2</li>
                <li>消费3</li>
            </ul>
        </div>
        <section></section>
    </div>
</body>
</html>
<script>
    // 给 销售订单 和 消费订单 添加一个hover事件
    $('#dingdang').hover(function(){
        $('.dd').css('display','block');
    },function(){
        $('.dd').css('display','none');
    });
    $('#xaiofei').hover(function(){
            $('.xf').css('display','block');
    },function(){
        $('.xf').css('display','none');
    });

    // 给 订单 和 消费 添加一个hover事件
    $('.dd').hover(function(){
            $('.dd').css('display','block');
    },function(){
        $('.dd').css('display','none');
    });
    $('.xf').hover(function(){
            $('.xf').css('display','block');
    },function(){
        $('.xf').css('display','none');
    });

    // 让点击的事件显示出来
    $('.xb li').click(function(){
        $('section').text($(this).text());
    })
</script>